﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics.Contracts;

namespace Isuka.Cola
{
    public partial interface IDynamicLibrary
        : IDisposable
    {
        Delegate GetDelegate(Type type, string name = null);
    }


    #region IDynamicLibrary contract binding
    [ContractClass(typeof(IDynamicLibraryContract))]
    public partial interface IDynamicLibrary
    {

    }

    [ContractClassFor(typeof(IDynamicLibrary))]
    abstract class IDynamicLibraryContract : IDynamicLibrary
    {
        #region IDynamicLibrary メンバー

        public Delegate GetDelegate(Type type, string name = null)
        {
            Contract.Requires<ArgumentNullException>(type != null, "type");
            Contract.Ensures(Contract.Result<Delegate>() != null);

            throw new NotImplementedException();
        }

        #endregion

        #region IDisposable メンバー

        public void Dispose()
        {
            throw new NotImplementedException();
        }

        #endregion
    }

    #endregion

}
